package com.yao.koin.adapter

import com.bumptech.glide.Glide
import com.yao.koin.R
import com.yao.koin.BR
import com.yao.koin.bean.DataX


class ActivityGrilAdapter(layoutResId: Int = R.layout.item_article_constraint) : BaseBindAdapter<DataX>(layoutResId, BR.gird) {

    private var showStar = true

    fun showStar(showStar: Boolean) {
        this.showStar = showStar
    }

    override fun convert(helper: BindViewHolder, item: DataX) {
        super.convert(helper, item)


        Glide.with(mContext).load(item.images[0]).placeholder(R.mipmap.logo)
            .into(helper.getView(R.id.articleImg))

        helper.addOnClickListener(R.id.articleImg)


//        if (showStar) helper.setImageResource(R.id.articleStar, if (item.collect) R.drawable.timeline_like_pressed else R.drawable.timeline_like_normal)
//        else helper.setVisible(R.id.articleStar, false)


//        helper.setText(R.id.articleAuthor, if (item.author.isBlank()) "分享者: ${item.shareUser}" else item.author)
//        Timer.stop(APP_START)
    }
}